from hellperTool import *


@timer()
def insertSort(arr):
    length = len(arr)
    for i in range(1,length):
        x = arr[i]
        for j in range(i,-1,-1):
            if x < arr[j-1]:
                arr[j] = arr[j-1]
            else:
                break
            arr[j] = x
    return arr


if __name__ == '__main__':
    arr = generateRandomArray(1000000,0,100)
    insertSort(arr)
    print(isSorted(arr))